<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="f" uri="http://www.sctv.com/tags/form"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="/WEB-INF/views/head.jsp"/>
    <script type="text/javascript">
      $(function() {
        $("#sortHead").headSort();
      });

    </script>
</head>
<body class="skin-blue content-body">
<jsp:include page="/WEB-INF/views/commons/show_message.jsp"/>
<div class="content-header">
    <h1><s:message code="favorite.management"/> - <s:message code="list"/> <small>(<s:message code="totalElements" arguments="${pagedList.totalElements}"/>)</small></h1>
</div>
<div class="content">
    <div class="box box-primary">
        <div class="box-body table-responsive">
            <form class="form-inline ls-search" action="list.do" method="get">
                <div class="form-group">
                    <label><s:message code="user"/></label>
                    <input class="form-control input-sm" type="text" name="search_LIKE_user.username" value="${requestScope['search_LIKE_user.username'][0]}" style="width:150px;"/>
                </div>
                <div class="form-group">
                    <label>数据id</label>
                    <input class="form-control input-sm" type="text" name="search_EQ_dataId" value="${search_EQ_dataId[0]}" style="width:350px;"/>
                </div>
                <div class="form-group">
                    <label>操作内容</label>
                    <input class="form-control input-sm" type="text" name="search_CONTAIN_description" value="${search_CONTAIN_description[0]}" style="width:350px;"/>
                </div>
                <div class="form-group">
                    <label>操作类型</label>
                    <input class="form-control input-sm" type="text" name="search_CONTAIN_name" value="${search_CONTAIN_name[0]}" style="width:350px;"/>
                </div>
                <button class="btn btn-default btn-sm" type="submit"><s:message code="search"/></button>
            </form>
            <form method="post">
                <tags:search_params/>
                <div class="btn-toolbar ls-btn-bar"></div>
                <table id="pagedTable" class="table table-condensed table-bordered table-hover ls-tb form-inline">
                    <thead id="sortHead" pagesort="<c:out value='${page_sort[0]}' />" pagedir="${page_sort_dir[0]}" pageurl="list.do?page_sort={0}&page_sort_dir={1}&${searchstringnosort}">
                    <tr class="ls_table_th">
                        <%--<th width="20"><input type="checkbox" onclick="Cms.check('ids',this.checked);"/></th>--%>
                        <th width="40"><s:message code="username"/></th>
                        <th width="70" class="ls-th-sort"><span class="ls-sort" pagesort="ip">IP地址</span></th>
                        <th width="70" class="ls-th-sort"><span class="ls-sort" pagesort="dataId">数据id</span></th>
                        <th width="160" class="ls-th-sort"><span class="ls-sort" pagesort="description">操作内容</span></th>
                        <th width="160" class="ls-th-sort"><span class="ls-sort" pagesort="name">操作类型</span></th>
                        <th width="140" class="ls-th-sort"><span class="ls-sort" pagesort="time"><s:message code="favorite.created"/></span></th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="bean" varStatus="status" items="${pagedList.content}">
                        <tr beanid="${bean.id}">
                            <%--<td align="center"><input type="checkbox" name="ids" value="${bean.id}"/></td>--%>
                            <td align="center"><c:out value="${bean.user.username}"/></td>
                            <td align="center"><c:out value="${bean.ip}"/></td>
                            <td align="center"><c:out value="${bean.dataId}"/></td>
                            <td align="center"><c:out value="${bean.description}"/></td>
                            <td align="center"><c:out value="${bean.name}"/></td>
                            <td align="center"><c:out value="${bean.time}"/></td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
                <c:if test="${fn:length(pagedList.content) le 0}">
                    <div class="ls-norecord"><s:message code="recordNotFound"/></div>
                </c:if>
            </form>
            <form action="list.do" method="get" class="ls-page">
                <tags:search_params excludePage="true"/>
                <tags:pagination pagedList="${pagedList}"/>
            </form>
        </div>
    </div>
</div>
</body>
</html>
